﻿Public Class DataAccess
    Public sqlConn As SqlClient.SqlConnection
    Public sqlDbRead As SqlClient.SqlDataReader
    Public dbSet As Data.DataSet
    Public sqlCmd As SqlClient.SqlCommand
    Public sqlAdp As SqlClient.SqlDataAdapter
    Public strConn As String = Configs.ConnectionString

    Public Sub New()

    End Sub

    Public Sub OpenConnect()
        Try
            'If sqlConn Is Nothing Then sqlConn = New SqlClient.SqlConnection(Configs.ConnectionString)
            'If sqlConn.State = ConnectionState.Closed Then
            'sqlConn.Open()
            'End If

            sqlConn = New SqlClient.SqlConnection(strConn)
            If sqlConn.State = ConnectionState.Closed Then
                sqlConn.Open()
            End If
        Catch ex As Exception
        End Try
    End Sub

    Public Sub CloseConnect()
        Try
            If Not sqlConn Is Nothing Then If sqlConn.State = System.Data.ConnectionState.Open Then sqlConn.Close()
            sqlConn = Nothing
        Catch ex As Exception
        End Try
    End Sub
End Class
